home *** CD-ROM | disk | FTP | other *** search
/ Treccani Italiana Di Scienze Lettere Ed Arti / [Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso / pc / data / xxi_appendice_dvd.swf / scripts / __Packages / mx / remoting / NetServiceProxy.as < prev    next >
Text File  |  2007-11-08  |  2KB  |  53 lines

  1. class mx.remoting.NetServiceProxy extends Object
  2. {
  3.    static var init = mx.remoting.NetServiceProxy.registerNetServiceProxy();
  4.    var _allowRes = false;
  5.    function NetServiceProxy(netC, servName, cli)
  6.    {
  7.       super();
  8.       if(netC != null)
  9.       {
  10.          this.nc = netC;
  11.          this.serviceName = servName;
  12.          this.client = cli;
  13.       }
  14.       this._allowRes = true;
  15.    }
  16.    function _setParentService(service)
  17.    {
  18.       this.nc = service.nc;
  19.       this.client = service.client;
  20.    }
  21.    function __resolve(methodName)
  22.    {
  23.       if(this._allowRes)
  24.       {
  25.          var _loc3_ = function()
  26.          {
  27.             if(this.client != null)
  28.             {
  29.                arguments.unshift(new mx.remoting.NetServiceProxyResponder(this,methodName));
  30.             }
  31.             else if(typeof arguments[0].onResult != "function")
  32.             {
  33.                mx.remoting.NetServices.trace("NetServices","warning",3,"There is no defaultResponder, and no responder was given in call to " + methodName);
  34.                arguments.unshift(new mx.remoting.NetServiceProxyResponder(this,methodName));
  35.             }
  36.             if(typeof this.serviceName == "function")
  37.             {
  38.                this.serviceName = this.servicename;
  39.             }
  40.             arguments.unshift(this.serviceName + "." + methodName);
  41.             return this.nc.call.apply(this.nc,arguments);
  42.          };
  43.          return _loc3_;
  44.       }
  45.       return null;
  46.    }
  47.    static function registerNetServiceProxy()
  48.    {
  49.       Object.registerClass("NetServiceProxy",mx.remoting.NetServiceProxy);
  50.       return true;
  51.    }
  52. }
  53.